package com.kyrioscraft.cloud.security.thirdpartylogin;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

@SpringBootApplication
@ComponentScan(basePackages = "com.kyrioscraft.cloud.security")  //扫描到引入项目中的配置
@RestController
public class ThirdpartyLoginApplication {

	public static void main(String[] args) {
		SpringApplication.run(ThirdpartyLoginApplication.class, args);
	}

	@GetMapping("/me")
	public String me(Principal principal) {
		return principal.getName();
	}

}

